Conventionally, there is a game system which allows a user to play a game based on a change of a load applied by the user. For example, in the above-mentioned game system, when a user gets on a board type controller including a load sensor, the load sensor detects a load value. Based on the load value, game processing is executed.
However, in the above-mentioned game system, the game processing is executed in the state where a direction of the board type controller and a direction of the user on the board type controller are defined in a fixed manner in advance. Therefore, the user is always requested to make an operation conformed to the defined direction, which limits operation methods. For example, when the user makes an operation while being oriented in a direction different from the defined direction on the board type controller, the operation made by the user cannot be accurately input to a game apparatus, and thus the game processing desired by the user cannot be executed.
Accordingly, an object of this example embodiment is to provide a storage medium having an information processing program stored thereon, an information processing apparatus, an information processing system, and an information processing method capable of making an accurate determination on an action of a user and performing processing suitable to the action.
In order to achieve the above object, the example embodiment has, for example, the following features. It should be understood that the scope of the example embodiment is interpreted only by the scope of the claims. In event of any conflict between the scope of the claims and the scope of the description in this section, the scope of the claims has priority.
An example of a configuration of a computer-readable storage medium having an information processing program stored thereon is executed by a computer of an information processing apparatus capable of using data which is output from an input device capable of allowing a body of a user to get thereon and is based on a load applied on the input device, the information processing apparatus being for processing data acquired from the input device. The information processing program allows the computer to execute repeatedly acquiring a center-of-gravity position of a load applied on the input device, based on data output from the input device; calculating a user direction of a stepping action made on the input device, using the center-of-gravity position; and performing predetermined processing based on the user direction.
According to the above configuration, the user direction on the input device can be determined, and thus the processing suitable to the user direction can be performed.
The user direction may be calculated based on a moving direction of the center-of-gravity position.
According to the above configuration, the user direction can be easily calculated based on the moving direction of the center-of-gravity position of the load applied on the input device.
The user direction may be calculated using a direction candidate which is vertical to a straight line connecting two center-of-gravity positions acquired at different timings.
According to the above configuration, the user direction can be easily calculated using the direction which is vertical to a straight line connecting two center-of-gravity positions acquired at different timings.
The user direction may be calculated using a direction candidate which is vertical to a straight line connecting two center-of-gravity positions acquired at different timings successively.
According to the above configuration, the user direction can be easily calculated using the direction which is vertical to a straight line connecting two center-of-gravity positions acquired at different timings successively.
The user direction may be updated by making the user direction determined by immediately previous processing closer to a direction represented by the direction candidate by a predetermined ratio.
According to the above configuration, the user direction is made closer to a direction represented by a newly obtained direction candidate by a predetermined ratio. Thus, the user direction can be updated to a user direction suitable to the action of the user while an error or the like involved in the newly obtained direction candidate is removed.
The ratio may be set to be larger as a distance between the center-of-gravity positions used for calculating the direction candidate is longer.
According to the above configuration, weighting can be performed such that the user direction is changed by a large amount when the moving amount of the center-of-gravity position is long, and thus the user direction can be estimated more accurately.
The user direction determined by the immediately previous processing does not need to be changed when the distance between the center-of-gravity positions used for calculating the direction candidate is shorter than a predetermined length.
According to the above configuration, an error which is caused when the user direction is estimated by use of a direction candidate can be removed.
A direction candidate which is vertical to a straight line connecting two center-of-gravity positions acquired at different timings repeatedly may be repeatedly calculated, and one candidate direction may be calculated based on a plurality of direction candidate repeatedly calculated.
According to the above configuration, one direction candidate is calculated using a plurality of direction candidates. Thus, the influence exerted on the estimation of the user direction by an error caused to the direction candidates unexpectedly.
One of a pair of directions vertical to the straight line which is closer to the user direction set currently may be calculated as the direction candidate.
According to the above configuration, the user direction can be determined more accurately utilizing that the user direction is not drastically changed.
When one of a pair of directions vertical to the straight line is present within a predetermined range, the other direction may be calculated as the direction candidate.
According to the above configuration, the precision of determination on the user direction can be improved by removing a user direction at a posture which is unlikely to be assumed by the user on the input device.
A direction candidate vector which is vertical to a straight line connecting two center-of-gravity positions acquired at different timings repeatedly and has a size equal to a distance between the two center-of-gravity positions may be repeatedly calculated, and a direction of one vector obtained by adding a plurality of direction candidate vectors calculated repeatedly may be calculated as the direction candidate.
According to the above configuration, the direction of the vector obtained as a result of the addition is the direction obtained by weighting performed with the moving amount of the center of gravity. Therefore, the user direction can be estimated more accurately.
One of a pair of directions vertical to the straight line which is closer to the user direction set currently may be calculated as the direction of the direction candidate vector.
According to the above configuration, the user direction can be determined more accurately utilizing that the user direction is not drastically changed.
When one of a pair of directions vertical to the straight line is present within a predetermined range, the other direction may be calculated as the direction of the direction candidate vector.
According to the above configuration, the precision of determination on the user direction can be improved by removing a user direction at a posture which is unlikely to be assumed by the user on the input device.
The information processing program may allow the computer to further execute setting at least one determination line extending in the calculated user direction. In this case, when the center-of-gravity position acquired repeatedly crosses the determination line, it may be determined that the user has made a stepping action on the input device and the predetermined processing may be performed based on the determination.
According to the above configuration, the user direction can be used for a determination on the stepping action on the input device.
The information processing program may allow the computer to further execute calculating a stepping central position of the user making the stepping action on the input device, based on the acquired center-of-gravity position. In this case, the determination line may be set at a position, in the user direction, having the stepping central position as a reference.
According to the above configuration, the determination line used for the determination on the stepping action can be set at an appropriate position.
Two said determination lines extending in the user direction at positions which have the stepping central position as the center therebetween and are distanced from the stepping central position by a predetermined gap may be set. It may be determined that the user has made a stepping action with one of user's legs on the input device when the center-of-gravity position crosses one of the determination lines after moving across the gap, it may be determined that the user has made a stepping action with the other of the user's legs on the input device when the center-of-gravity position crosses the other of the determination lines after moving across the gap, and the predetermined processing may be performed based on the determination.
According to the above configuration, determinations on the left foot stepping action and the right foot stepping action are made by different determination lines. Thus, a more accurate determination on the stepping action can be made.
The stepping central position may be set at a position which follows, at a predetermined ratio, the center-of-gravity position acquired repeatedly.
The stepping central position may be set at a position obtained by averaging the center-of-gravity positions acquired repeatedly during a predetermined time period.
According to the above configuration, the stepping central position can be easily calculated.
A width of the gap may be changed in accordance with an angle of the user direction with respect to a predetermined reference direction.
According to the above configuration, an appropriate determination line can be set in accordance with the shape or the like of the input device.
The predetermined processing may be performed by changing a direction of at least one of an object set in a virtual world and a virtual camera, based on the user direction.
According to the above configuration, the direction of the object in the virtual world or the virtual camera can be changed in accordance with the user direction.
The example embodiment may be implemented in the form of an information processing apparatus or an information processing system including units for performing each of the above-described processing or an information processing method including each of the above-described motions.
According to the example embodiment, it is made possible to determine the user direction on the input device and perform processing suitable to the user direction.
These and other objects, features, aspects and advantages of this example embodiment will become more apparent from the following detailed description when taken in conjunction with the accompanying drawings.